<template>
  <div class="main">
    <div class="header">
      <div class="epName">
        {{ info.name }}
        <span class="goBack" @click="$router.go(-1)">返回</span>
      </div>
      <div class="line"></div>
      <div
        class="tags flex-tag"
        :style="{ 'margin-top': info.cate == '行政区' ? '20px' : '' }"
      >
        <p v-if="info.cate == '行政区'">
          <span>载体类型：</span>{{ info.cate }}
        </p>
        <p v-if="info.cate == '行政区'" style="flex: 0 0 50%;">
          <span> 行政区所在地：</span>{{ info.address }}
        </p>
        <p v-if="info.cate != '行政区'">
          <span>园区级别：</span>{{ info.level }}
        </p>
        <p v-if="info.cate != '行政区'">
          <span>园区类型：</span>{{ info.cate }}
        </p>
        <p v-if="info.cate != '行政区'">
          <span>园区负责人：</span>{{ info.charge }}
        </p>
        <p v-if="info.cate != '行政区'">
          <span>联系电话：</span>{{ info.phone }}
        </p>
      </div>
      <div class="tags" v-if="info.cate != '行政区'">
        <p>
          <span>{{ info.cate == "行政区" ? "行政区" : "园区" }}所在地：</span
          >{{ info.address }}
        </p>
      </div>

      <div
        class="tags"
        :style="{ 'margin-top': info.cate == '行政区' ? '20px' : '' }"
      >
        <p>
          <span>{{ info.cate == "行政区" ? "行政区" : "园区" }}产业集群：</span
          >{{ info.cluster }}
        </p>
      </div>
    </div>
    <div class="main_body">
      <el-tabs v-model="activeName">
        <el-tab-pane
          :label="info.cate == '行政区' ? '行政区信息' : '园区信息'"
          name="info"
        >
          <div class="header_title"></div>
          <div class="table_one">
            <table border="1" padding="0" v-if="Object.keys(info).length > 0">
              <tr>
                <td>占地面积（平方公里）：</td>
                <td>{{ info.detail.acreage }}</td>
                <td>GDP：</td>
                <td>{{ info.detail.gdp }}</td>
              </tr>
              <tr>
                <td>税收要求（万元/亩）：</td>
                <td>{{ info.detail.tax }}</td>
                <td>产出要求（万元/亩）：</td>
                <td>{{ info.detail.out_power }}</td>
              </tr>
              <tr>
                <td>投资强度（万元/亩）：</td>
                <td>{{ info.detail.invest_power }}</td>
                <td>产业定位</td>
                <td>{{ info.detail.indu_need }}</td>
              </tr>
              <tr>
                <td>工业土地均价：</td>
                <td>{{ info.detail.indu_land }}</td>
                <td>协商土地均价：</td>
                <td>{{ info.detail.comm_land }}</td>
              </tr>
              <tr>
                <td>代表企业：</td>
                <td
                  colspan="3"
                  class="detail"
                  v-html="info.detail.represent"
                ></td>
              </tr>
            </table>
          </div>
        </el-tab-pane>
        <el-tab-pane
          :label="info.cate == '行政区' ? '行政区介绍' : '园区介绍'"
          name="js"
        >
          <div class="flex-box">
            <div class="map_box">
              <baidu-map
                v-if="activeName == 'js'"
                class="bm-view"
                :center="{ lng: info.jwd.lng, lat: info.jwd.lat }"
                :zoom="15"
                :scroll-wheel-zoom="true"
              >
                <bm-marker
                  :position="{ lng: info.jwd.lng, lat: info.jwd.lat }"
                  :icon="{ url: iconPng, size: { width: 36, height: 41 } }"
                >
                </bm-marker>
              </baidu-map>
            </div>
            <div class="info">
              <div class="detail">
                {{ info.intriduce }}
              </div>
            </div>
          </div>
          <!-- <div class="height_box"></div> -->
        </el-tab-pane>
        <el-tab-pane label="投资成本" name="tz">
          <div class="header_title">投资成本</div>
          <div class="table_one">
            <table border="1" padding="0" v-if="Object.keys(info).length > 0">
              <tr>
                <td>居民用电(一档)</td>
                <td>{{ info.invest.resident_ele_one }}</td>
                <td>居民用电(二档)</td>
                <td>{{ info.invest.resident_ele_two }}</td>
                <td>居民用电(三档)</td>
                <td>{{ info.invest.resident_ele_thr }}</td>
              </tr>
              <tr>
                <td>商业用电(峰段)</td>
                <td>{{ info.invest.comm_ele_one }}</td>
                <td>商业用电(平段)</td>
                <td>{{ info.invest.comm_ele_two }}</td>
                <td>商业用电(谷段)</td>
                <td>{{ info.invest.comm_ele_thr }}</td>
              </tr>
              <tr>
                <td>工业电价(峰段)</td>
                <td>{{ info.invest.indu_ele_one }}</td>
                <td>工业电价(平段)</td>
                <td>{{ info.invest.indu_ele_two }}</td>
                <td>工业电价(谷段)</td>
                <td>{{ info.invest.indu_ele_thr }}</td>
              </tr>

              <tr>
                <td>居民用水(一档)</td>
                <td>{{ info.invest.resident_water_one }}</td>
                <td>居民用水(二档)</td>
                <td>{{ info.invest.resident_water_two }}</td>
                <td>居民用水(三档)</td>
                <td>{{ info.invest.resident_water_thr }}</td>
              </tr>
              <tr>
                <td>商业用水</td>
                <td>{{ info.invest.comm_water }}</td>
                <td>工业用水</td>
                <td>{{ info.invest.indu_water }}</td>
                <td>特种用水</td>
                <td>{{ info.invest.special_water }}</td>
              </tr>
              <tr>
                <td>居民用气(一档)</td>
                <td>{{ info.invest.resident_natgas_one }}</td>
                <td>居民用气(二档)</td>
                <td>{{ info.invest.resident_natgas_two }}</td>
                <td>居民用气(三档)</td>
                <td>{{ info.invest.resident_natgas_thr }}</td>
              </tr>
              <tr>
                <td>污水处理</td>
                <td>{{ info.invest.sewage }}</td>
                <td>最低工资标准</td>
                <td>{{ info.invest.wagelevel }}</td>
                <td>高层管理人员</td>
                <td>{{ info.invest.highmag }}</td>
              </tr>
              <tr>
                <td>普通员工</td>
                <td>{{ info.invest.worker }}</td>
                <td>中级管理人员</td>
                <td colspan="3">{{ info.invest.middlemag }}</td>
              </tr>
            </table>
          </div>
          <div class="height_box"></div>
        </el-tab-pane>
        <el-tab-pane label="配套环境" name="hj">
          <div class="header_title">配套环境</div>
          <div class="table_one">
            <table border="1" padding="0" v-if="Object.keys(info).length > 0">
              <tr>
                <td>距货运站距离</td>
                <td>{{ info.config.dis_freight }}</td>
              </tr>
              <tr>
                <td>距高铁距离</td>
                <td>{{ info.config.dis_rail }}</td>
              </tr>
              <tr>
                <td>距机场距离</td>
                <td>{{ info.config.dis_air }}</td>
              </tr>
              <tr>
                <td>公路运输</td>
                <td>{{ info.config.road_trans }}</td>
              </tr>
              <tr>
                <td>铁路运输</td>
                <td>{{ info.config.rail_trans }}</td>
              </tr>
              <tr>
                <td>园区生活配套</td>
                <td>{{ info.config.live_facility }}</td>
              </tr>
              <tr>
                <td>百货商场</td>
                <td>{{ info.config.market }}</td>
              </tr>
              <tr>
                <td>酒店商务</td>
                <td>{{ info.config.hotel_bus }}</td>
              </tr>
              <tr>
                <td>医疗</td>
                <td>{{ info.config.medical }}</td>
              </tr>
              <tr>
                <td>教育</td>
                <td>{{ info.config.education }}</td>
              </tr>
            </table>
          </div>
          <div class="height_box"></div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import { CarrierDetails } from "@api/details";
import BaiduMap from "vue-baidu-map/components/map/Map.vue";
import iconPng from "@img/public/icon-location.png";
export default {
  data() {
    return {
      activeName: "info",
      activeMenu: "",
      info: {
        jwd: { lng: "112.548879", lat: "37.870590" },
      },

      iconPng: iconPng,
    };
  },
  components: {
    BaiduMap,
  },
  mounted() {
    this.id = this.$route.params.id;
    this.activeMenu = this.$route.params.activeMenu;
    this.$bus.$emit("setActive", this.activeMenu);
    this.getDetail(this.id);
  },
  methods: {
    async getDetail(id) {
      let res = await CarrierDetails({ id });
      if (res.code && res.code != 0) {
      } else {
        this.info = res;
      }
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  width: 100%;
  height: 100%;
  background: #fff;
  overflow: hidden;
  text-align: left;
  .header {
    box-sizing: border-box;
    width: 100%;
    height: 260px;
    background: url("~@img/public/bg-img-xzq&cyyq.png") no-repeat center;
    padding: 0 210px;
  }
  .main_body {
    width: 100%;
    height: calc(100% - 260px);
  }
}

.epName {
  height: 108px;
  line-height: 108px;
  font-size: 40px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #ffffff;
  span {
    margin-left: 30px;
    display: inline-block;
    width: 70px;
    height: 30px;
    line-height: 30px;
    background: #f89718;
    opacity: 0.8;
    border-radius: 4px;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
  }
  .goBack {
    margin-top: 40px;
    float: right;
    width: 100px;
    height: 38px;
    line-height: 38px;
    background: #5889dc;
    font-weight: 400;
    opacity: 1;
  }
}
.line {
  height: 1px;
  background: #ffffff;
  opacity: 0.5;
}
.flex-tag {
  display: flex;
  justify-content: space-between;
}
.tags {
  height: 20px;
  font-size: 20px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #ffffff;
  line-height: 56px;
  opacity: 0.9;
  margin-bottom: 20px;
  span {
    opacity: 0.5;
  }
}
.epClassify {
  display: flex;
  justify-content: flex-start;

  li {
    flex: 1;
    padding: 0 80px;
    margin-top: 30px;
    position: relative;
    cursor: pointer;
    &::before {
      position: absolute;
      top: 50%;
      left: 0;
      margin-top: -20px;
      display: block;
      content: "";
      width: 1px;
      height: 40px;
      background: #ffffff;
      opacity: 0.5;
    }
    &:first-of-type {
      padding-left: 0;
      &::before {
        opacity: 0;
      }
    }
    p {
      font-size: 20px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #ffffff;
      line-height: 56px;
      opacity: 0.6;
      white-space: nowrap;
      &:last-child {
        font-size: 22px;
        opacity: 0.9;
      }
    }
  }
}
.header_title {
  margin-top: 30px;
  margin-bottom: 20px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #333333;
}

.detail {
  text-indent: 2em;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #333333;
  line-height: 32px;
  max-height: 390px;
  overflow-y: auto;
  scrollbar-color: #767ffe #e9f3ff; //滚动条轨道颜色   滚动条滑块的颜色
  scrollbar-width: 6px;
  scrollbar-width: thin; //thin模式下滚动条两端的三角按钮会消失
  // overflow-y: auto;
  &::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
    height: 10px;
  }
  &::-webkit-scrollbar-thumb {
    /*滚动条里面小方块*/
    border-radius: 10px;
    background: linear-gradient(0deg, #767ffe, #79aefe);
  }
  &::-webkit-scrollbar-track {
    /*滚动条里面轨道*/
    background: #e9f3ff;
    border-radius: 10px;
  }
}
.flex-box {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  .map_box {
    flex: 0 0 50%;
    margin-top: 30px;
    background: #e6e7e7;
    box-shadow: 0px 0px 9px 0px rgba(189, 189, 189, 0.67);
    border-radius: 10px;
  }
}
.info {
  flex: 0 0 45%;
  font-size: 16px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #666666;
  line-height: 18px;
  margin-top: 30px;
  p {
    margin-bottom: 10px;
  }
}
.bm-view {
  width: 100%;
  height: 100%;
}

// 选项卡样式修改
/deep/ .el-tabs__nav-scroll {
  padding-left: 210px;
}
/deep/.el-tabs__item {
  padding: 0 60px 0 0;
  font-size: 20px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #333333;
  height: 60px;
  line-height: 60px;
}
/deep/.el-tabs__item.is-active {
  font-weight: bold;
  color: #0043b3;
}
/deep/.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  padding-left: 0px;
}
/deep/.el-tabs__active-bar {
  height: 4px;
  background: #0043b3;
}
/deep/ .el-tabs__nav-wrap {
  box-shadow: 0px 2px 6px 0px rgba(4, 0, 0, 0.1);
}
/deep/ .el-tabs__nav-wrap::after {
  height: 0;
}
/deep/.el-tabs__header {
  margin: 0;
}
/deep/ .el-tab-pane {
  width: 100%;
  height: 100%;
}
/deep/.el-tabs {
  height: 100%;
  .el-tabs__content {
    box-sizing: border-box;
    height: calc(100% - 60px);
    padding: 0px 240px 30px;
    overflow-y: auto;
    scrollbar-color: #767ffe #e9f3ff; //滚动条轨道颜色   滚动条滑块的颜色
    scrollbar-width: 6px;
    scrollbar-width: thin; //thin模式下滚动条两端的三角按钮会消失
    // overflow-y: auto;
    &::-webkit-scrollbar {
      /*滚动条整体样式*/
      width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
      height: 10px;
    }
    &::-webkit-scrollbar-thumb {
      /*滚动条里面小方块*/
      border-radius: 10px;
      background: linear-gradient(0deg, #767ffe, #79aefe);
    }
    &::-webkit-scrollbar-track {
      /*滚动条里面轨道*/
      background: #e9f3ff;
      border-radius: 10px;
    }
  }
}
/deep/ .rel-node-checked {
  box-shadow: 0px 0px 10px #2f48c8;
  animation: none;
}
/deep/ .rel-node-shape-0:hover {
  box-shadow: 0px 0px 10px #2f48c8;
}
/deep/ .rel-node-peel:hover .rel-node {
  box-shadow: 0px 0px 10px #2f48c8;
}

.main .header {
  padding: 0 210px;
}
.height_box {
  height: 30px;
}
.table_one table {
  width: 100%;
  border-color: #ddd;
  tr {
    td {
      padding: 0 20px;
      height: 42px;
      line-height: 42px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #333333;
    }
    td:nth-of-type(odd) {
      width: 190px;
      background: #f7faff;
    }
    td:nth-of-type(even) {
      width: 280px;
    }
    .detail {
      padding: 15px 20px;
      line-height: 22px;
    }
  }
}

@media screen and (min-width: 1366px) and (max-width: 1600px) {
  .main .header {
    padding: 0 20px;
  }
  /deep/ .el-tabs .el-tabs__content {
    padding: 0px 200px 30px;
  }
}
@media only screen and (width: 1366px) {
  .main .header {
    padding: 0 20px;
  }
  /deep/ .el-tabs .el-tabs__content {
    padding: 0px 200px 30px;
  }
}
@media screen and (max-width: 1200px) {
  .main .header {
    padding: 0 20px;
  }
  .epClassify li p {
    font-size: 16px;
  }
  .epClassify li p:last-child {
    font-size: 18px;
  }
  .epClassify li {
    padding: 0 30px;
  }
  /deep/ .el-tabs__nav-scroll {
    padding-left: 30px;
  }
  /deep/ .el-tabs .el-tabs__content {
    padding: 0 30px 30px;
  }
  .detail[data-v-65c8d7fb] {
    font-size: 14px;
  }
  .info p {
    font-size: 12px;
  }
}

</style>
